#include "pickable.h"

Pickable::Pickable(){
    SetPickingColor(pcm.GetUniqueColor());
}


void Pickable::SetPickingColor(unsigned int pickingColor[]){
	this->pickingColor[0] = pickingColor[0];
	this->pickingColor[1] = pickingColor[1];
	this->pickingColor[2] = pickingColor[2];
}

unsigned int Pickable::GetID(){
    return pickingColor[0]+pickingColor[1]*256+pickingColor[2]*65536;
}

void Pickable::GenerateNewID(){
    SetPickingColor(pcm.GetUniqueColor());
}

//void Pickable::SetID(int id){
//	pickingColor[0] = 0;
//	pickingColor[1] = 0;
//	pickingColor[2] = 0;
//    while(id>65536){
//        pickingColor[2]++;
//        id-=65536;
//    }
//    while(id>256){
//        pickingColor[1]++;
//        id-=256;
//    }
//    pickingColor[0] = id;
//}
